package org.HisCanvas.ChrisRiffle.JFlightLog.common;

import org.HisCanvas.ChrisRiffle.JFlightLog.dataModel.LogBook;
import org.HisCanvas.ChrisRiffle.JFlightLog.dataModel.LogBookRec;


/**
 * LogBookRecUtils
 * @author RIF
 *
 */
public class LogBookUtils {
	
	private static final String NEW_LINE = "\n";
	
	
	/**
	 * toString
	 * @param pLogBook
	 * @return
	 */
	public static String toString(LogBook pLogBook){
		
		
		if(pLogBook == null){
			return null;
		}
		
		String rLogBookString = "";
		
		for(LogBookRec iLogBookRec : pLogBook.getLogBookRecList()){
			
			rLogBookString += "\n" + toString(iLogBookRec);
		}
		
		
		return rLogBookString;
	}
	
	
	/**
	 * toString
	 * @param pLogBookRec
	 * @return
	 */
	public static String toString(LogBookRec pLogBookRec){
		
		if(pLogBookRec == null){
			
			return null;
		}
		
		String rLogBookRecString = "";
				
		rLogBookRecString += NEW_LINE + pLogBookRec.getPrimaryKey();
		rLogBookRecString += NEW_LINE + pLogBookRec.getFlightDate();
		rLogBookRecString += NEW_LINE + pLogBookRec.getAircraftType();
		rLogBookRecString += NEW_LINE + pLogBookRec.getAircraftRegistration();
		rLogBookRecString += NEW_LINE + pLogBookRec.getDepartAirportCode();
		rLogBookRecString += NEW_LINE + pLogBookRec.getArrivalAirportCode();
		rLogBookRecString += NEW_LINE + pLogBookRec.getLandingsTotalCount();
		rLogBookRecString += NEW_LINE + pLogBookRec.getLandingsDayCount();
		rLogBookRecString += NEW_LINE + pLogBookRec.getLandingsNightCount();
		rLogBookRecString += NEW_LINE + pLogBookRec.getSingleEngineHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getMultiEngineHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getxCountryHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getDayHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getNightHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getInstrumentActualHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getInstrumentSimHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getIapCount();
		rLogBookRecString += NEW_LINE + pLogBookRec.getIapNames();
		rLogBookRecString += NEW_LINE + pLogBookRec.getSafetyPilotName();
		rLogBookRecString += NEW_LINE + pLogBookRec.getSimHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getDualReceivedHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getDualGivenHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getPicHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getSicHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getSoloHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getTotalHours();
		rLogBookRecString += NEW_LINE + pLogBookRec.getRemarks();
		
		return rLogBookRecString;
	}
	
	
	

}


